package com.mingdinggroup.app;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import com.mingdinggroup.app.util.CacheManager;

public class MainActivity extends AppCompatActivity {
    CacheManager cacheManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        cacheManager = CacheManager.getInstance();

    }

    public void write(View view) {
        cacheManager.putCache("http://192.168.1.20/index.php?s=/Apps/article/indexs", "{\"status\":1,\"data\":{\"ad\":[{\"id\":\"5\",\"title\":\"3\",\"isapp\":\"1\",\"postion\":\"0\",\"target\":\"_blank\",\"picurl\":\"\\/Uploads\\/Picture\\/2017-04-13\\/58ef3b529479e.jpg\",\"linkurl\":\"\",\"level\":\"0\",\"descrip\":\"\",\"posttime\":\"1492073318\",\"deadline\":\"0\",\"status\":\"1\"},{\"id\":\"2\",\"title\":\"2\",\"isapp\":\"1\",\"postion\":\"0\",\"target\":\"_blank\",\"picurl\":\"\\/Uploads\\/Picture\\/2017-04-13\\/58ef3a30b8f4b.jpg\",\"linkurl\":\"http:\\/\\/www.gxmdtz.com\",\"level\":\"0\",\"descrip\":\"\",\"posttime\":\"1492073015\",\"deadline\":\"1970\",\"status\":\"1\"},{\"id\":\"1\",\"title\":\"\\u9ed8\\u8ba4\\u5e7f\\u544a\",\"isapp\":\"1\",\"postion\":\"0\",\"target\":\"_blank\",\"picurl\":\"\\/Uploads\\/Picture\\/2016-11-18\\/582e8bd2c1988.png\",\"linkurl\":\"http:\\/\\/wap.mingdinggroup.com\",\"level\":\"0\",\"descrip\":\"\\u9ed8\\u8ba4\\u5e7f\\u544a\",\"posttime\":\"1481470314\",\"deadline\":\"1970\",\"status\":\"1\"}],\"article\":[{\"id\":\"3\",\"title\":\"\\u6218\\u7565\\u5408\\u4f5c\\u4f19\\u4f34\",\"isapp\":\"1\",\"postion\":\"1\",\"target\":\"_blank\",\"picurl\":\"\\/Uploads\\/Picture\\/2016-12-11\\/584d6f719c713.png\",\"linkurl\":\"http:\\/\\/www.gxmdtz.com\",\"level\":\"0\",\"descrip\":\"\\u6218\\u7565\\u5408\\u4f5c\\u4f19\\u4f34\",\"posttime\":\"1481470289\",\"deadline\":\"1970\",\"status\":\"1\",\"type\":1},{\"id\":\"473\",\"uid\":\"0\",\"name\":\"\",\"title\":\"\\u4f9b\\u9700\\u57fa\\u672c\\u9762\\u6301\\u7eed\\u6539\\u5584 \\u6a61\\u80f6\\u4ef7\\u683c\\u4e2d\\u671f\\u770b\\u6da8\",\"category_id\":\"2\",\"group_id\":\"0\",\"description\":\"\\u4f9b\\u9700\\u57fa\\u672c\\u9762\\u6301\\u7eed\\u6539\\u5584  \\r\\n\\u6a61\\u80f6\\u4ef7\\u683c\\u4e2d\\u671f\\u770b\\u6da8\\r\\n\\u4e00\\u5ea6\\u900a\\u8272\\u4e8e\\u7126\\u7164\\u3001\\u7126\\u70ad\\u3001\\u7532\\u9187\\u7b49\\u5546\\u54c1\\u7684\\u5929\\u7136\\u6a61\\u80f6\\uff0c\\u8fd1\\u6765\\u4e5f\\u88ab\\u671f\\u8d27\\u5e02\\u573a\\u8d44\\u91d1\\u76f8\\u4e2d\\uff0c\\u671f\\u4ef7\\u6da8\\u52bf\\u8fce\\u5934\\u8d76\\u8d85\\u3002\\r\\n\\u201c\\u4eca\\u5e74\\u8f6e\\u80ce\\u4f01\\u4e1a\\u9700\\u6c42\\u8d85\\u9884\\u671f\\uff0c\\u6a61\\u80f6\\u6b63\\u5728\\u8d70\\u5927\\u7684\\u7b51\\u5e95\\u884c\\u60c5\\uff0c\\u660e\\u5e74\\u4e00\\u5b63\\u5ea6\\uff0c\\u5373\\u4e1c\\u5357\\u4e9a\\u6a61\\u80f6\\u5f00\\u5272\\u524d\\u6216\\u6709\\u4e00\\u6ce2\\u5411\\u4e0a\\u7684\\u884c\\u60c5\\u3002\\u201d\\u56fd\\u6cf0\\u541b...\",\"root\":\"0\",\"pid\":\"0\",\"model_id\":\"2\",\"type\":\"2\",\"position\":\"4\",\"link_id\":\"0\",\"cover_id\":\"1\",\"display\":\"1\",\"deadline\":\"0\",\"attach\":\"0\",\"view\":\"447\",\"comment\":\"0\",\"extend\":\"0\",\"level\":\"0\",\"create_time\":\"1477804200\",\"update_time\":\"1477831750\",\"status\":\"1\",\"picurl\":\"\\/Uploads\\/nopic\\/nopic.png\"},{\"id\":\"474\",\"uid\":\"0\",\"name\":\"\",\"title\":\"\\u7164\\u70ad\\u6da8\\u4ef7\\u6f6e\\u6682\\u9000 \\u7126\\u7164\\u201c\\u8df3\\u6c34\\u201d\\u8dcc\\u903e4.5%\",\"category_id\":\"2\",\"group_id\":\"0\",\"description\":\"\\u5728\\u6628\\u65e5\\u7164\\u4ef7\\u51b2\\u9ad8\\u56de\\u843d\\u540e\\uff0c27\\u65e5\\u7126\\u70ad\\u3001\\u7126\\u7164\\u591a\\u7a7a\\u53cc\\u65b9\\u8fce\\u6765\\u201c\\u51b3\\u6218\\u65e5\\u201d\\u3002\\r\\n27\\u65e511\\u65f6\\u5de6\\u53f3\\uff0c\\u7a7a\\u65b9\\u7a81\\u7136\\u53d1\\u529b\\uff0c\\u201c\\u4e09\\u7164\\u201d\\u5e94\\u58f0\\u4e0b\\u632b\\u3002\\u622a\\u81f3\\u5f53\\u65e5\\u5348\\u76d8\\uff0c\\u52a8\\u529b\\u7164\\u3001\\u7126\\u7164\\u671f\\u8d27\\u4e3b\\u529b\\u5408\\u7ea6\\u5206\\u522b\\u4e0b\\u8dcc4.74%\\u548c4.5%\\uff0c\\u7126\\u70ad1701\\u5408\\u7ea6\\u5219\\u4e0b\\u8dcc3.19%\\u3002\\r\\n\\u81f3\\u6b64\\uff0c\\u5ef6\\u7eed\\u4e86\\u4e00\\u4e2a\\u591a\\u6708\\u7684...\",\"root\":\"0\",\"pid\":\"0\",\"model_id\":\"2\",\"type\":\"2\",\"position\":\"4\",\"link_id\":\"0\",\"cover_id\":\"1\",\"display\":\"1\",\"deadline\":\"0\",\"attach\":\"0\",\"view\":\"61\",\"comment\":\"0\",\"extend\":\"0\",\"level\":\"0\",\"create_time\":\"1477804200\",\"update_time\":\"1477831741\",\"status\":\"1\",\"picurl\":\"\\/Uploads\\/nopic\\/nopic.png\"},{\"id\":\"3513\",\"uid\":\"1\",\"name\":\"\",\"title\":\"\\u4e2d\\u592e\\u519b\\u59d4\\u4e3b\\u5e2d\\u4e60\\u8fd1\\u5e73\\u7b7e\\u7f72\\u547d\\u4ee4\\u53d1\\u5e03\\u300a\\u519b\\u4e8b\\u7acb\\u6cd5\\u5de5\\u4f5c\\u6761\\u4f8b\\u300b\",\"category_id\":\"48\",\"group_id\":\"0\",\"description\":\"\\u592e\\u89c6\\u7f51\\u6d88\\u606f\\uff08\\u65b0\\u95fb\\u8054\\u64ad\\uff09\\uff1a\\u65e5\\u524d\\uff0c\\u4e2d\\u592e\\u519b\\u59d4\\u4e3b\\u5e2d\\u4e60\\u8fd1\\u5e73\\u7b7e\\u7f72\\u547d\\u4ee4\\uff0c\\u53d1\\u5e03\\u300a\\u519b\\u4e8b\\u7acb\\u6cd5\\u5de5\\u4f5c\\u6761\\u4f8b\\u300b\\uff0c\\u81ea2017\\u5e745\\u67088\\u65e5\\u8d77\\u65bd\\u884c\\u3002\\r\\n\\r\\n\\u3000\\u3000\",\"root\":\"0\",\"pid\":\"0\",\"model_id\":\"2\",\"type\":\"2\",\"position\":\"0\",\"link_id\":\"0\",\"cover_id\":\"0\",\"display\":\"1\",\"deadline\":\"0\",\"attach\":\"0\",\"view\":\"2\",\"comment\":\"0\",\"extend\":\"0\",\"level\":\"0\",\"create_time\":\"1494482220\",\"update_time\":\"1494556836\",\"status\":\"1\",\"picurl\":false},{\"id\":\"4\",\"title\":\"\\u4f01\\u4e1a\\u8d44\\u8d28\",\"isapp\":\"1\",\"postion\":\"1\",\"target\":\"_system\",\"picurl\":\"\\/Uploads\\/Picture\\/2016-12-07\\/58480e8aa8807.jpg\",\"linkurl\":\"http:\\/\\/www.gxmdtz.com\",\"level\":\"0\",\"descrip\":\"\\u6a21\\u62df\\u5f00\\u6237\",\"posttime\":\"1488785572\",\"deadline\":\"1970\",\"status\":\"1\",\"type\":1},{\"id\":\"3512\",\"uid\":\"0\",\"name\":\"\",\"title\":\"\\u5de6\\u5c0f\\u857e\\uff1a\"\\u677e\\u7ed1\"\\u7684\\u80a1\\u6307\\u671f\\u8d27\\u662f\\u52a9\\u6da8\\u52a9\\u8dcc\\u7684\",\"category_id\":\"48\",\"group_id\":\"0\",\"description\":\"\\u7f51\\u6613\\u8d22\\u7ecf1\\u670820\\u65e5\\u6d88\\u606f&#160;\\u8fd1\\u671f\\uff0cIPO\\u53d1\\u884c\\u52a0\\u901f\\u5f15\\u8d77\\u5e02\\u573a\\u70ed\\u8bae\\u3002\\u81ea\\u53bb\\u5e74\\u5e74\\u5e95\\u4ee5\\u6765\\uff0c\\u65b0\\u80a1\\u53d1\\u884c\\u8282\\u594f\\u6108\\u53d1\\u52a0\\u5feb\\uff0c\\u4eca\\u5e74\\u66f4\\u662f\\u6216\\u5c06\\u6d88\\u5316500\\u5bb6\\u5de6\\u53f3IPO\\u5b58\\u91cf\\u3002IPO\\u7a76\\u7adf\\u4f1a\\u5426\\u538b\\u57ae\\u5927\\u76d8\\uff1fA\\u80a1\\u80fd\\u5426\\u65e9\\u65e5\\u8fce\\u6765\\u6ce8\\u518c\\u5236\\uff1f\\u7f51\\u6613\\u8d22\\u7ecf\\u7279\\u9080\\u56fd\\u52a1\\u9662\\u53c2\\u4e8b\\u5ba4\\u7279\\u7ea6\\u7814\\u7a76\\u5458\\u3001\\u94f6\\u6cb3\\u8bc1\\u5238\\u539f...\",\"root\":\"0\",\"pid\":\"0\",\"model_id\":\"2\",\"type\":\"2\",\"position\":\"4\",\"link_id\":\"0\",\"cover_id\":\"220\",\"display\":\"1\",\"deadline\":\"0\",\"attach\":\"0\",\"view\":\"82\",\"comment\":\"0\",\"extend\":\"0\",\"level\":\"0\",\"create_time\":\"1493696940\",\"update_time\":\"1493973189\",\"status\":\"1\",\"picurl\":\"\\/\"},{\"id\":\"3511\",\"uid\":\"0\",\"name\":\"\",\"title\":\"\\u8d5a\\u7ffb\\uff01\\u53bb\\u5e74\\u671f\\u8d27\\u79c1\\u52df\\u524d10\\u5f3a\\u5e73\\u5747\\u6536\\u76ca919.38%\",\"category_id\":\"48\",\"group_id\":\"0\",\"description\":\"2016\\u5e74\\u706b\\u70ed\\u7684\\u5546\\u54c1\\u671f\\u8d27\\u884c\\u60c5\\u8ba9\\u4e0d\\u5c11\\u671f\\u8d27\\u79c1\\u52df\\u8d5a\\u5f97\\u4e0d\\u83f2\\u4e1a\\u7ee9\\uff0c\\u5c24\\u5176\\u5bf9\\u98ce\\u683c\\u504f\\u6fc0\\u8fdb\\u7684\\u5355\\u8d26\\u6237\\u671f\\u8d27\\u79c1\\u52df\\u800c\\u8a00\\uff0c\\u66f4\\u662f\\u5982\\u6b64\\u3002\\u4e1a\\u7ee9\\u795e\\u8bdd\\u4e0d\\u65ad\\u5237\\u65b0\\uff0c\\u65e9\\u65e9\\u9501\\u5b9a\\u5e74\\u5ea6\\u6700\\u8d5a\\u94b1\\u79c1\\u52df\\u3002\\r\\n\\u8d857\\u6210\\u76c8\\u5229\\u4e0a\\u6f14\\u4e1a\\u7ee9\\u76db\\u5bb4\\r\\n\\u636e\\u79c1\\u52df\\u6392\\u6392\\u7f51\\u4e0d\\u5b8c\\u5168\\u7edf\\u8ba1\\uff0c2016\\u7eb3\\u5165\\u7edf\\u8ba1\\u6392\\u540d\\u7684\\u3001\\u65d7\\u4e0b\\u81f3\\u5c11\\u542b1\\u53ea\\u6210\\u7acb\\u6ee1...\",\"root\":\"0\",\"pid\":\"0\",\"model_id\":\"2\",\"type\":\"2\",\"position\":\"0\",\"link_id\":\"0\",\"cover_id\":\"219\",\"display\":\"1\",\"deadline\":\"0\",\"attach\":\"0\",\"view\":\"13\",\"comment\":\"0\",\"extend\":\"0\",\"level\":\"0\",\"create_time\":\"1493696940\",\"update_time\":\"1494569282\",\"status\":\"1\",\"picurl\":\"\\/\"},{\"id\":\"3510\",\"uid\":\"0\",\"name\":\"\",\"title\":\"\\u5927\\u5546\\u6240\\u5c06\\u52a0\\u7d27\\u63a8\\u8fdb\\u7389\\u7c73\\u671f\\u6743\\u7814\\u7a76\",\"category_id\":\"48\",\"group_id\":\"0\",\"description\":\"2\\u67086\\u65e5\\uff0c\\u5927\\u5546\\u6240\\u76f8\\u5173\\u8d1f\\u8d23\\u4eba\\u5c31\\u843d\\u5b9e2017\\u5e74\\u4e2d\\u592e\\u4e00\\u53f7\\u6587\\u4ef6\\u8868\\u793a\\uff0c\\u5927\\u5546\\u6240\\u5c06\\u5c3d\\u5feb\\u63a8\\u8fdb\\u8c46\\u7c95\\u7b49\\u519c\\u4ea7\\u54c1\\u671f\\u6743\\u4e0a\\u5e02\\uff0c\\u52a0\\u5927\\u751f\\u732a\\u7b49\\u76f8\\u5173\\u519c\\u4ea7\\u54c1\\u671f\\u8d27\\u54c1\\u79cd\\u7684\\u5f00\\u53d1\\u7814\\u7a76\\u529b\\u5ea6\\u3002\\r\\n\\u4e2d\\u592e\\u4e00\\u53f7\\u6587\\u4ef6\\u6307\\u51fa\\uff0c\\u8981\\u201c\\u6df1\\u5165\\u63a8\\u8fdb\\u519c\\u4ea7\\u54c1\\u671f\\u8d27\\u3001\\u671f\\u6743\\u5e02\\u573a\\u5efa\\u8bbe\\uff0c\\u79ef\\u6781\\u5f15\\u5bfc\\u6d89\\u519c\\u4f01\\u4e1a\\u5229\\u7528\\u671f\\u8d27\\u3001\\u671f\\u6743\\u7ba1\\u7406\\u5e02\\u573a\\u98ce...\",\"root\":\"0\",\"pid\":\"0\",\"model_id\":\"2\",\"type\":\"2\",\"position\":\"0\",\"link_id\":\"0\",\"cover_id\":\"2111\",\"display\":\"1\",\"deadline\":\"0\",\"attach\":\"0\",\"view\":\"3\",\"comment\":\"0\",\"extend\":\"0\",\"level\":\"0\",\"create_time\":\"1493696940\",\"update_time\":\"1494578710\",\"status\":\"1\",\"picurl\":\"\\/Uploads\\/Picture\\/2017-05-12\\/59157614d065e.png\"}],\"category\":[{\"id\":\"1\",\"variety\":\"XIGUI\\u5c3f\\u7d20\",\"codes\":\"hf_CL\",\"svrurl\":\"http:\\/\\/v.mingdinggroup.com:2016?username=\",\"appicon\":{\"id\":\"7\",\"path\":\"\\/Uploads\\/Picture\\/2016-11-11\\/5825d058632a4.png\",\"url\":\"\",\"md5\":\"03834eba16635dba41af05170d72d628\",\"sha1\":\"636d0f39cb6f84f044eaac1c9214525f582cc56e\",\"status\":\"1\",\"create_time\":\"1478873176\"},\"exchange\":\"\\u897f\\u90e8\\u8d35\\u91d1\\u5c5e\",\"posttime\":\"1470904206\",\"edittime\":\"1481470629\",\"descrip\":\"\\u5c3f\\u7d20\",\"status\":\"1\"},{\"id\":\"2\",\"variety\":\"COMEX\\u767d\\u94f6\",\"codes\":\"hf_SI\",\"svrurl\":\"\",\"appicon\":{\"id\":\"6\",\"path\":\"\\/Uploads\\/Picture\\/2016-11-11\\/5825d0506ef83.png\",\"url\":\"\",\"md5\":\"0f0fb037ead3cc4c40824570b0209b3c\",\"sha1\":\"28dde474efd2f57c14291ddba4af7d2587ac2443\",\"status\":\"1\",\"create_time\":\"1478873168\"},\"exchange\":\"\\u7ebd\\u7ea6\\u671f\\u8d27\\u4ea4\\u6613\\u6240\",\"posttime\":\"1470904261\",\"edittime\":\"1478873169\",\"descrip\":\"\\u7ebd\\u4ea4\\u6240\\u767d\\u94f6\",\"status\":\"1\"},{\"id\":\"3\",\"variety\":\"COMEX\\u9ec4\\u91d1\",\"codes\":\"hf_GC\",\"svrurl\":\"\",\"appicon\":{\"id\":\"5\",\"path\":\"\\/Uploads\\/Picture\\/2016-11-11\\/5825d04554c52.png\",\"url\":\"\",\"md5\":\"6c0ea395d142143f11bdf38dc458c5e8\",\"sha1\":\"b6835e73f3d9eaf3b9d4097da2e04f690af9a541\",\"status\":\"1\",\"create_time\":\"1478873157\"},\"exchange\":\"\\u7ebd\\u7ea6\\u671f\\u8d27\\u4ea4\\u6613\\u6240\",\"posttime\":\"1470904319\",\"edittime\":\"1478873159\",\"descrip\":\"\\u7ebd\\u7ea6\\u91d1\",\"status\":\"1\"},{\"id\":\"4\",\"variety\":\"COMEX\\u94dc\",\"codes\":\"hf_HG\",\"svrurl\":\"\",\"appicon\":{\"id\":\"4\",\"path\":\"\\/Uploads\\/Picture\\/2016-11-11\\/5825cfb3a80c9.png\",\"url\":\"\",\"md5\":\"74e8dab57eef3382cebce38d738bf37e\",\"sha1\":\"af74c8768c51494a998a00c7dbd3c9131e43f65d\",\"status\":\"1\",\"create_time\":\"1478873011\"},\"exchange\":\"\\u7ebd\\u7ea6\\u671f\\u8d27\\u4ea4\\u6613\\u6240\",\"posttime\":\"1470904378\",\"edittime\":\"1478873013\",\"descrip\":\"\\u7ebd\\u4ea4\\u6240\\u94dc\",\"status\":\"1\"}],\"subs\":null},\"info\":null}");
    }

    public void read(View view) {
        String json = cacheManager.getCache("http://192.168.1.20/index.php?s=/Apps/article/indexs");
        Log.d("====", json);
    }
}
